<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加/编辑配送方式 - Powered By ${systemConfig.systemName}</title>
<meta name="Author" content="JFinalShop Team" />
<meta name="Copyright" content="JFinalShop" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<% include("/common/include.html"){}%>
<link href="${base}/template/admin/css/input.css" rel="stylesheet" type="text/css" />
<%
var isAdd = false;
var isEdit = false;
if(isEmpty(deliveryType.id)){
	isAdd = true;
}else{
	isEdit = true;
}%>
</head>
<body class="input">
	<div class="body">
		<div class="inputBar">
			<h1><span class="icon">&nbsp;</span><%if(isAdd){%>添加配送方式<%}else{%>编辑配送方式<%}%></h1>
		</div>
		<form id="inputForm" class="validate" action="<%if (isAdd){%>${base}/deliveryType/save<%}else{%>${base}/deliveryType/update<%}%>" method="post">
			<input type="hidden" name="deliveryType.id" value="${deliveryType.id!}" />
			<table class="inputTable">
				<tr>
					<th>
						配送方式名称:
					</th>
					<td>
						<input type="text" name="deliveryType.name" class="formText {required: true, remote: '${base}/deliveryType/checkName?${deliveryType.name!}', messages: {remote: '配送方式名称已存在!'}}" value="${deliveryType.name!}" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						配送类型:
					</th>
					<td>
						<select name="deliveryMethod">
							<%for(list in allDeliveryMethod){%>
								<option value="${list}"<%if (list == deliveryType.deliveryMethod!){%> selected <%}%>>
									${i18n("DeliveryMethod." + list)}
								</option>
							<%}%>
						</select>
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						默认物流公司:
					</th>
					<td>
						<select name="deliveryType.defaultDeliveryCorp_id">
							<option value="">请选择...</option>
							<%for(list in allDeliveryCorp){%>
								<option value="${list.id}" <%if (list.id == deliveryType.defaultDeliveryCorp_id!){%>selected <%}%>>
									${list.name}
								</option>
							<%}%>
						</select>
					</td>
				</tr>
				<tr>
					<th>
						首重量:
					</th>
					<td>
						<input type="text" name="deliveryType.firstWeight" class="formText {required: true, min: 0, messagePosition: '#firstWeightMessagePosition'}" value="${deliveryType.firstWeight!}" />
						<select name="firstWeightUnit">
							<%for(list in allWeightUnit){%>
								<option value="${list}"<%if (list == deliveryType.firstWeightUnit!){%> selected <%}%>>
									${i18n("WeightUnit." + list)}
								</option>
							<%}%>
						</select>
						<span id="firstWeightMessagePosition"></span>
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						续重量:
					</th>
					<td>
						<input type="text" name="deliveryType.continueWeight" class="formText {required: true, min: 0, messagePosition: '#continueWeightMessagePosition'}" value="${deliveryType.continueWeight!}" />
						<select name="continueWeightUnit">
							<%for(list in allWeightUnit){%>
								<option value="${list}"<%if (list == deliveryType.continueWeightUnit!){%> selected <%}%>>
									${i18n("WeightUnit." + list)}
								</option>
							<%}%>
						</select>
						<span id="continueWeightMessagePosition"></span>
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						首重价格:
					</th>
					<td>
						<input type="text" name="deliveryType.firstWeightPrice" class="formText {required: true, min: 0}" value="${deliveryType.firstWeightPrice!}" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						续重价格:
					</th>
					<td>
						<input type="text" name="deliveryType.continueWeightPrice" class="formText {required: true, min: 0}" value="${deliveryType.continueWeightPrice!}" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						排序:
					</th>
					<td>
						<input type="text" name="deliveryType.orderList" class="formText {digits: true, required: true}" value="${deliveryType.orderList!50}" title="只允许输入零或正整数" />
						<label class="requireField">*</label>
					</td>
				</tr>
				<tr>
					<th>
						介绍:
					</th>
					<td>
						<textarea name="deliveryType.description" class="wysiwyg" rows="20" cols="100">${deliveryType.description!}</textarea>
					</td>
				</tr>
			</table>
			<div class="buttonArea">
				<input type="submit" class="formButton" value="确  定" hidefocus="true" />&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回" hidefocus="true" />
			</div>
		</form>
	</div>
</body>
</html>